package com.niuwa.p2p.core.enums;

/**
 * 消息发送内容数据源枚举
 * @author money
 *
 */
public enum MsgSourceEnum {
	USER_NAME("userName", "用户名"),
	VERIFY_CODE("verifyCode","验证码"),
	PRODUCT_NAME("productName","产品名称"),
	PRODUCT_DUE_DATE("productDueDate","产品到期日"),
	PURCHASE_TIME("purchaseTime","认购时间"),
	PURCHASE_LIMIT_TIME("purchaseLimitTime","认购期限"),
	PURCHASE_AMOUNT("purchaseAmount","认购金额"),
	APPLY_TIME("applyTime","申请时间"),
	TOTAL_BACK_MONEY("totalBackMoney","回款总额"),
	BACK_MONEY("backMoney","回款金额"),
	RESET_PASSWORD_LINK("resetPasswordLink","重置密码连接"),
	NEXT_PAYMENT_DAY("nextPaymentDay","下次还款日"),
	RETURN_AMOUNT("returnAmount","还款金额"),
	LINK("link","链接"),
	EMAIL("email","邮箱"),
	NEW_EMAIL("newEmail","新邮箱"),
	ENVELOP_NAME("envelopName","红包名称"),
	ENVELOP_AMOUNT("envelopAmount","红包金额"),
	INVALID_DAY("invalidTime","失效日期"),
	ADD_NEW_FRIEND_WORDS("addNewFriendWords","加好友申请留言"),
	CURRENT_PERIOD_REPAY_AMOUNT("currentPeriodRepayAmount","本期还款金额"),
	BORROW_KIND("borrowKind","借款类型"),
	BORROW_TITLE("borrowTitle","借款标题"),
	OVER_DUEDAYS("overDueDays","逾期天数"),
	NICK_NAME("nickName","昵称"),
	APP_NAME("appName","App名称")
	;

	private final String key;
	private final String info;

	private MsgSourceEnum(String key, String info) {
		this.key = key;
		this.info = info;
	}

	public String getKey() {
		return key;
	}

	public String getInfo() {
		return info;
	}

	@Override
	public String toString() {
		return this.getKey();
	}
	public static MsgSourceEnum getEnumByInfo(String info) {
		for (MsgSourceEnum t : MsgSourceEnum.values()) {
			if (t.getInfo().equals(info)) {
				return t;
			}
		}
		return null;
	}
	public static String getKeyByInfo(String info) {
		for (MsgSourceEnum t : MsgSourceEnum.values()) {
			if (t.getInfo().equals(info)) {
				return t.key;
			}
		}
		return null;
	}
	public static MsgSourceEnum getSourceEnumByKey(String key){
		for(MsgSourceEnum t : MsgSourceEnum.values()){
			if(t.getKey().equals(key)){
				return t;
			}
		}
		return null;
	}
}
